package com.internetCafes.spms.common.module.excel;

import org.jeecgframework.poi.excel.entity.ExcelBaseParams;
import org.jeecgframework.poi.handler.inter.IExcelVerifyHandler;

public class ImportSheetParams extends ExcelBaseParams {

	/**
	 * 表格标题行数,默认0
	 */
	private int titleRows = 0;
	/**
	 * 表头行数,默认1
	 */
	private int headRows = 1;
	/**
	 * 字段真正值和列标题之间的距离 默认0
	 */
	private int startRows = 0;
	/**
	 * 主键设置,如何这个cell没有值,就跳过 或者认为这个是list的下面的值
	 */
	private final Integer keyIndex = 0;
	/**
	 * 开始读取的sheet位置,默认为0
	 */
	private final int startSheetIndex = 0;
	/**
	 * 上传表格需要读取的sheet 数量,默认为1
	 */
	private final int sheetNum = 1;
	/**
	 * 是否需要保存上传的Excel,默认为false
	 */
	private final boolean needSave = false;
	/**
	 * 是否需要校验上传的Excel,默认为false
	 */
	private final boolean needVerfiy = false;
	/**
	 * 校验处理接口
	 */
	private IExcelVerifyHandler verifyHanlder;
	/**
	 * 最后的无效行数
	 */
	private int lastOfInvalidRow = 0;
	/**
	 * 导入时校验数据模板,是不是正确的Excel
	 */
	private String[] importFields;

	private Class<?> clazz;

	public ImportSheetParams(String[] importFields, Class<?> clazz) {
		super();
		this.importFields = importFields;
		this.clazz = clazz;
	}

	public ImportSheetParams(String sheetKey,int titleRows, int headRows, String[] importFields, Class<?> clazz) {
		super();
		this.titleRows = titleRows;
		this.headRows = headRows;
		this.importFields = importFields;
		this.clazz = clazz;
	}
	public ImportSheetParams(int titleRows, int headRows, String[] importFields, Class<?> clazz) {
	    super();
	    this.titleRows = titleRows;
	    this.headRows = headRows;
	    this.importFields = importFields;
	    this.clazz = clazz;
	}

	public ImportSheetParams(int titleRows, int headRows, int startRows, String[] importFields, Class<?> clazz) {
		super();
		this.titleRows = titleRows;
		this.headRows = headRows;
		this.startRows = startRows;
		this.importFields = importFields;
		this.clazz = clazz;
	}

	public ImportSheetParams(int titleRows, int headRows, int startRows, IExcelVerifyHandler verifyHanlder, int lastOfInvalidRow, String[] importFields, Class<?> clazz) {
		super();
		this.titleRows = titleRows;
		this.headRows = headRows;
		this.startRows = startRows;
		this.verifyHanlder = verifyHanlder;
		this.lastOfInvalidRow = lastOfInvalidRow;
		this.importFields = importFields;
		this.clazz = clazz;
	}

	public IExcelVerifyHandler getVerifyHanlder() {
		return verifyHanlder;
	}

	public void setVerifyHanlder(IExcelVerifyHandler verifyHanlder) {
		this.verifyHanlder = verifyHanlder;
	}

	public String[] getImportFields() {
		return importFields;
	}

	public void setImportFields(String[] importFields) {
		this.importFields = importFields;
	}

	public int getTitleRows() {
		return titleRows;
	}

	public int getHeadRows() {
		return headRows;
	}

	public int getStartRows() {
		return startRows;
	}

	public Integer getKeyIndex() {
		return keyIndex;
	}

	public int getStartSheetIndex() {
		return startSheetIndex;
	}

	public int getSheetNum() {
		return sheetNum;
	}

	public boolean isNeedSave() {
		return needSave;
	}

	public boolean isNeedVerfiy() {
		return needVerfiy;
	}

	public int getLastOfInvalidRow() {
		return lastOfInvalidRow;
	}

	public Class<?> getClazz() {
		return clazz;
	}

	public void setClazz(Class<?> clazz) {
		this.clazz = clazz;
	}
}
